package com.hdu.priority;


public class PriorityRunnable implements Runnable {


    private final int priority;
    private final Runnable original;

    @Override
    public void run() {
        original.run();
    }

    private PriorityRunnable(Runnable runnable, int priority) {
        this.priority = priority;
        original = runnable;
    }


    public static PriorityRunnable of(Runnable runnable, int priority) {
        return new PriorityRunnable(runnable, priority);
    }


    public int getPriority() {
        return priority;
    }
}
